<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>酒店介绍</title>
    <link href="css/css.css" rel="stylesheet" type="text/css">
</head>

<body>
    <header>
        <div class="head_c">
            <!--头部-->
            <div class="top">
                <div class="top_left">欢迎光临悠游行！</div>
                <div class="top_right" style="display: flex;" id="login_signup_area">
                    <div class="top_right"><a href="login.html">登录</a><a href="zhuce.html">注册</a></div>
                </div>
                <div class="top_right" style="display: flex;" id="logout_area">
                    <a class="top_right" id="login_info" style="font-weight: bold;">用户：15159241643</a>
                    <div class="top_right logout_button" onclick="logout()">退出登录</div>
                </div>
            </div>
        </div>
    </header>

    <!--导航-->
    <nav>
        <ul>
            <li><a href="index.html">网站首页</a></li>
            <li><a href="jingdian.html">著名景点</a></li>
            <li><a href="luxian.html">推荐路线</a></li>
            <li class="on"><a href="jiudian.html">酒店入住</a></li>
            <li><a href="luntan.html">论坛热帖</a></li>
        </ul>
    </nav>

    <!--banner-->
    <div class="banner"></div>


    <div class="jiudian_jieshao">
    </div>





    <footer>悠游行</footer>
</body>

</html>

<script src="./js/utils.js"></script>
<script>
    display_login_info();
    show_hotel_info();
    function show_hotel_info() {
        id = getCookieValue("selected_hotel_id");
        table = document.querySelector(".jiudian_jieshao");
        api = baseUrl2 + `/hotel/getById?id=${id}`;
        fetch(api, {
            method: "GET",
            headers: {
                "Content-Type": "application/json",
            }
        }).then(response => response.json())
            .then(data => {
                info = data["data"];
                table.innerHTML = `
        <div class="jiudian_left">
            <div class="jiudian_jianjie">
                <img src="${info.imagePath ?? ""}" alt="" style="width: 387px; height: 261px;" />
                <p>${info.introduction}</p>
            </div>
        </div>
        <div class="jiudian_rightt">
            <div class="lianxi">
                <div class="lianxi_tittle">联系我们</div>
                <p>地址：${info.position ?? "一个未知的地址"}</p>
                <p>电话：${info.phoneNumber ?? "012-34567"}</p>
                <p>联系人：${info.managerName ?? "吴名氏"}</p>
                <p>官网：www.no_exist.com</p>
            </div>
            <a href="yuding.html">
                <div class="yuding">立即预定</div>
            </a>
        </div>
                `
            }).catch(error => {
                console.error(error);
            })
    }
</script>